$main-bg: #f5f7fa;
$card-shadow: 0 2px 8px #f0f1f2;
$item-shadow: 0 1px 4px #e5e6eb;
$radius: 6px;
$title-color: #222;
$text-color: #555;
$primary-font: 16px;
$secondary-font: 15px;
$item-title-font: 17px;

@mixin flex-center {
  display: flex;
  align-items: center;
}

.department-container {
  background: $main-bg;
  padding: 16px;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  overflow: auto;
}

.search-card {
  margin-bottom: 18px;
  box-shadow: $card-shadow;
}

.search-bar {
  @include flex-center;
  gap: 16px;
  padding: 16px;
}

.search-title {
  font-weight: bold;
  font-size: $primary-font;
  margin-right: 12px;
}

.search-input {
  width: 220px;
}

.add-btn {
  margin-left: auto;
}

.list-card {
  padding: 18px 24px 10px 24px;
  box-shadow: $card-shadow;
}

.list-title {
  font-weight: bold;
  font-size: $secondary-font;
  margin-bottom: 18px;
}

.department-item {
  background: #fff;
  border-radius: $radius;
  padding: 18px 18px 12px 18px;
  margin-bottom: 18px;
  box-shadow: $item-shadow;
  position: relative;
  transition: box-shadow 0.2s;
  display: flex;
  align-items: start;
  justify-content: space-between;
  &:hover {
    box-shadow: 0 4px 12px #e0e2e6;
  }
  .item-left {
    flex:1;
    padding-right: 16px;
  }
  .item-header {
    @include flex-center;
    margin-bottom: 8px;
  }
  .item-title {
    font-size: $item-title-font;
    font-weight: 600;
    color: $title-color;
  }
  .item-content {
    color: $text-color;
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.7;
    word-break: break-all;
  }
  .edit-btn {
    position: absolute;
    right: 18px;
    top: 18px;
  }
}

.pagination-container {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .total-count {
    color: #606266;
    font-size: 13px;
  }
  :deep(.el-pagination) {
    position: unset;
  }
}

.department-dialog {
  .el-dialog__header {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    padding-bottom: 0;
    letter-spacing: 2px;
  }
  .el-dialog__body {
    padding: 32px 32px 0 32px;
  }
  .dialog-form {
    .el-form-item {
      margin-bottom: 22px;
      align-items: flex-start;
      .el-form-item__label {
        font-weight: 500;
        color: #333;
        font-size: 15px;
        white-space: nowrap;
        line-height: 32px;
        width: 120px;
        text-align: right;
        padding-right: 12px;
      }
      .el-input,
      .el-select {
        width: 320px;
      }
      .el-textarea__inner {
        min-height: 100px;
        resize: vertical;
        font-size: 15px;
      }
    }
  }
  .el-dialog__footer {
    text-align: right;
    padding: 20px 32px 24px 32px;
    .el-button + .el-button {
      margin-left: 16px;
    }
  }
}